Get User API
POST /user
Description
This API endpoint retrieves information about the currently authenticated user.
Request Body
The request utilizes GraphQL to perform the user
query.
Query:
query user {
user {
id
email
username
resellerId
role
enabled
radAccess
radAccessClear
createdAt
updatedAt
}
}
Variables:
{}
Example Request:
curl --location '' \
--header 'Content-Type: application/json' \
--data '{"query":"query user {\n user {\n id\n email\n username\n resellerId\n role\n enabled\n radAccess\n radAccessClear\n createdAt\n updatedAt\n }\n}","variables":{}}'
Response:
-
Success (200 OK):
- The response contains details about the authenticated user.
{
"data": {
"user": {
"id": "<User_ID>",
"email": "<User_Email>",
"username": "<User_Username>",
"resellerId": "<Reseller_ID>",
"role": "<User_Role>",
"enabled": <Boolean>,
"radAccess": <Boolean>,
"radAccessClear": <Boolean>,
"createdAt": "<Creation_Timestamp>",
"updatedAt": "<Update_Timestamp>"
}
}
} -
Error (4XX/5XX):
- If there is an issue with retrieving the user data, such as authentication errors or server errors, the response will include an appropriate error message and status code.
Note:
Make sure the request is authenticated, as this query requires user authentication to return the correct user details.